<?php
require 'functions.php';
require 'data/data.php';

$id = $_GET['id'];

/*//建立到mysql服务器的链接
$conn = mysqli_connect(`locallhost:8088`,'root','123456');
//选定数据库
mysqli_select_db($conn,'demo');

$sql = "delete from user where id={$id}";

mysqli_query($conn,$sql);

$affected = mysqli_affected_rows($conn);*/

$sql = "delete from user where id=?";
$args = [$id];
$affected = execute($sql ,$args);

if ($affected === 1) {
	success('删除成功');
}else{
	error('删除失败','index.php');
}
?>